package whf.framework.web.query;

import whf.framework.util.StringUtils;

/**
 * @author administrator
 *
 */
public class StringField extends Field{
	public StringField(String name, String[] values){
		super(name, values);
	}
	
	@Override
	public String toHQLString() {
		if(StringUtils.isEmpty(values[0])) 
			return "";
		else {
			if(values[0].indexOf("%") >= 0)
				return "(t."+name+" like '" + values[0] +"')";
			else
				return "(t."+name+"='" + values[0] +"')";
		}
	}

}
